package com.blueheart.music.service.impl;

import com.blueheart.music.mapper.RankMapper;
import com.blueheart.music.model.pojo.Rank;
import com.blueheart.music.service.RankService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class RankServiceImpl implements RankService {
    @Autowired
    private RankMapper rankMapper;
    /**
     * 查询评分通过歌单id
     *
     * @param songListId
     * @return
     */
    @Override
    public List<Rank> findBySongListId(Integer songListId) {
        return rankMapper.selectBySongListId(songListId);
    }

    /**
     * 新增评分
     *
     * @param rank
     * @return
     */
    @Override
    public boolean addScore(Rank rank) {
        return rankMapper.insertSelective(rank)>0;
    }
}
